BOOL StringToClipBoard(char* srcString){
    BOOL bResult = FALSE;
    DWORD dwLength = strlen(srcString);
    HANDLE hGlobalMemory = GlobalAlloc(GHND, dwLength + 1);
    LPBYTE lpGlobalMemory = (LPBYTE)GlobalLock(hGlobalMemory);
    if ( NULL != lpGlobalMemory )
    {
        strcpy((char*)lpGlobalMemory, srcString);
        ::GlobalUnlock(hGlobalMemory); 
        ::OpenClipboard(NULL);
        ::EmptyClipboard();
        ::SetClipboardData(CF_TEXT, hGlobalMemory);
        ::CloseClipboard();
 
        bResult = TRUE;
    }
    return bResult;
}
